package gameManager;

import java.awt.Dimension;
import java.awt.Point;
import java.util.ArrayList;
import java.util.List;
/**
* The moving enemy created by extending the NonPlayerCharacter
*@author Kannan Raju
*/
public class EnemyMoving extends NonPlayerCharacter{

    /**
    *
    *@param startPosition start position
    *@param startDirection start direction
    */
    public EnemyMoving (Point startPosition, int startDirection) {
        super(startPosition, startDirection);
        setSpeed(10);
        setObjectImage("EnemyMovingRect.jpg");
        setDimension(new Dimension(getObjectImage().getWidth(null), getObjectImage().getHeight(null)));
        setNameOfInteractable("EnemyMoving");
        addCollisionObject("PlayerAmmo");
        addCollisionObject("PlayerRect");
        setHealthValue(3);
    }
/**
*
* check if the health value is less or equal to zero
*/
    @Override
    public boolean isDying () {
        return getHealthValue()<=0; 
    }
/**
*
* override the destroy method
*/
    @Override
    public void destroy () {
    }
/**
* 
* @param collisionCharacter
*/
    @Override
    public void collisionHandler (Interactable collisionCharacter) {
        if (collisionCharacter.getNameOfInteractable() == "PlayerAmmo") {
            changeHealthValue(-1);
        }
        if (collisionCharacter.getNameOfInteractable() == "PlayerRect") {
            setHealthValue(0);
        }
        
    }
}
